/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package bsc.ejb.entity;

import bsc.ejb.metadata.Colorimetry;
import bsc.ejb.metadata.MapDrawing;
import java.io.Serializable;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;

/**
 *
 * @author memozac
 */
@Entity
public class MapDrawingSettings implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private Long idMapDrawingSettings;

    @ManyToOne
    @JoinColumn(name="idSettings",nullable=false,updatable=true)
    private Settings settings;

    @ManyToOne
    @JoinColumn(name="idMapDrawing",nullable=false,updatable=true)
    private MapDrawing mapDrawing;

    private Double x;
    private Double y;

    public Long getIdMapDrawingSettings() {
        return idMapDrawingSettings;
    }

    public void setIdMapDrawingSettings(Long idMapDrawingSettings) {
        this.idMapDrawingSettings = idMapDrawingSettings;
    }

    public MapDrawing getMapDrawing() {
        return mapDrawing;
    }

    public void setMapDrawing(MapDrawing mapDrawing) {
        this.mapDrawing = mapDrawing;
    }

    public Settings getSettings() {
        return settings;
    }

    public void setSettings(Settings settings) {
        this.settings = settings;
    }

    public Double getX() {
        return x;
    }

    public void setX(Double x) {
        this.x = x;
    }

    public Double getY() {
        return y;
    }

    public void setY(Double y) {
        this.y = y;
    }
    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idMapDrawingSettings != null ? idMapDrawingSettings.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        if (!(object instanceof MapDrawingSettings)) {
            return false;
        }
        MapDrawingSettings other = (MapDrawingSettings) object;
        if ((this.idMapDrawingSettings == null && other.idMapDrawingSettings != null) || (this.idMapDrawingSettings != null && !this.idMapDrawingSettings.equals(other.idMapDrawingSettings))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "bsc.ejb.entity.MapDrawingSettings[id=" + idMapDrawingSettings + "]";
    }

}//ends of class